//
//  MainViewModel.m
//  OSChina
//
//  Created by 8b410-2 on 17/1/2.
//  Copyright © 2017年 abb. All rights reserved.
//

#import "OSCMainViewModel.h"
#import "OSCTweetListViewModel.h"
#import "OSCTweetComposeViewModel.h"
@interface OSCMainViewModel ()

@property (nonatomic, strong, readwrite) OSCPageViewModel *tweetPageViewModel;
@property (nonatomic, strong, readwrite) OSCBaseViewModel *newsViewModel;
@property (nonatomic, strong, readwrite) OSCBaseViewModel *myViewModel;
@property (nonatomic, strong, readwrite) OSCBaseViewModel *profileViewModel;

@end

@implementation OSCMainViewModel

- (void)initialize {
    [super initialize];
    OSCTweetListViewModel *newTweetViewModel = [[OSCTweetListViewModel alloc] initWithServices:self.services params:@{@"OSCTweetsType" :@(OSCTweetsTypeNew)}];
    OSCTweetListViewModel *hotTweetViewModel = [[OSCTweetListViewModel alloc] initWithServices:self.services params:@{@"OSCTweetsType" :@(OSCTweetsTypeHot)}];
    OSCTweetListViewModel *myTweetViewModel = [[OSCTweetListViewModel alloc] initWithServices:self.services params:@{@"OSCTweetsType" :@(OSCTweetsTypeMy)}];
    NSArray *tweetTitles = @[@"最新动弹", @"热门动弹", @"我的动弹"];
    self.tweetPageViewModel    = [[OSCPageViewModel alloc]
                                  initWithServices:self.services
                                  params:@{@"ViewModels" :@[newTweetViewModel,hotTweetViewModel,myTweetViewModel],
                                           @"Titles" :tweetTitles,
                                           @"title" :@"动弹"}];
    self.newsViewModel   = [[OSCBaseViewModel alloc] initWithServices:self.services params:nil];
    self.myViewModel = [[OSCBaseViewModel alloc] initWithServices:self.services params:nil];
    self.profileViewModel = [[OSCBaseViewModel alloc] initWithServices:self.services params:nil];
}

- (void)toTweetComposeViewModel {
    OSCTweetComposeViewModel *composeViewModel = [[OSCTweetComposeViewModel alloc] initWithServices:self.services params:@{@"title" : @"弹一弹"}];
    [self.services presentViewModel:composeViewModel animated:YES completion:nil];
}

@end
